package com.cc.springboot.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.cc.springboot.service.test01.User1Service;
import com.cc.springboot.service.test02.User2Service;


@RestController
public class IndexController {
	@Autowired
	private User1Service user1Service;
	@Autowired
	private User2Service user2Service;

	@RequestMapping("/add")
	public String index() {
		user1Service.addUser(1,"db user001");
		user2Service.addUser(2,"db user002");
		return "success";
	}
	
	
	@RequestMapping("/addUser1AndUser2")
	public String addUser1AndUser2() {
		user1Service.addUser1AndUser2();
		return "success";
	}

}
